home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / LongPointLib / LongPointLib.c next >
Encoding:
C/C++ Source or Header  |  1993-12-18  |  453 b   |  28 lines  |  [TEXT/KAHL]

  1. /* 93/12/18 aih created */
  2.  
  3. #include <limits.h>
  4. #include "LongPointLib.h"
  5.  
  6. void LPointFromPoint(LPointType *lpt, Point pt)
  7. {
  8.     lpt->h = pt.h;
  9.     lpt->v = pt.v;
  10. }
  11.  
  12. Point LPointToPoint(const LPointType *lpt)
  13. {
  14.     Point pt;
  15.     
  16.     require(SHRT_MIN <= lpt->h && lpt->h <= SHRT_MAX);
  17.     require(SHRT_MIN <= lpt->v && lpt->v <= SHRT_MAX);
  18.     pt.h = lpt->h;
  19.     pt.v = lpt->v;
  20.     return(pt);
  21. }
  22.  
  23. void LPointOffset(LPointType *lpt, long h, long v)
  24. {
  25.     lpt->h += h;
  26.     lpt->v += v;
  27. }
  28.